﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Repository.EntityFramework
{
    public class ServicesSiteBuildIntializer
        //: System.Data.Entity.CreateDatabaseIfNotExists<BaseDataContext>
        //: System.Data.Entity.DropCreateDatabaseAlways<BaseDataContext>
    : System.Data.Entity.DropCreateDatabaseIfModelChanges<BaseDataContext>
    {
        protected override void Seed(BaseDataContext context)
        {
            //createusers(context);
        }


        // 不能直接初始化数据了，得通过事件的模式来初始化数据。
        //private void createusers(DataContext context)
        //{
        //    string guid = new Guid().ToString();
        //    context.AccountIndex.Add(new Entities.AccountIndex { AccountId = guid, AccountName = "debug" });
        //    context.AccountInfo.Add(new Entities.AccountInfo
        //    {
        //        Id = guid,
        //        Name = "lcs",
        //        Password = "000000",
        //        CreatedOn = DateTime.Now,
        //        LastSignInTime = DateTime.Now,
        //        LastSignOutTime = DateTime.Now,
        //        LastIpAddress = "",
        //        TotalSignInTimes = 0,
        //        TotalSignOutTimes = 0,
        //        Version = 0,

        //    });

        //    context.Commit();
        //}



    }
}
